import sys
sys.path.insert(0, 'third_party')
sys.path.insert(0, '.')
from config import *
from common import *
from monitor import Monitor
from twisted.internet import reactor
from twisted.python.util import println
defaults_map = {
                'http_host' : MONITOR_HTTP_HOST,
                'http_port' : MONITOR_HTTP_PORT,
                'rpc_host'  : MONITOR_RPC_HOST,
                'rpc_port'  : MONITOR_RPC_PORT,
                'external_ip': MONITOR_EXTERNAL_IP,
                'external_port':MONITOR_EXTERNAL_PORT 
                }
def main():
    args = parse_opt(defaults_map)
    monitor = Monitor(**args)
    reactor.callLater(0.3, lambda : println("Reactor started"))    
    reactor.run()
if __name__ == '__main__':
    main()
    